Skip to content

Add serverFunctions.components: 'external' for hosts that own the document wiring - #341

Merged
ryansolid merged 1 commit into
nextfrom
server-components-external
Sep 2, 2026
Merged

Add serverFunctions.components: 'external' for hosts that own the document wiring#341
ryansolid merged 1 commit into
nextfrom
server-components-external

Conversation

@ryansolid

Copy link
Copy Markdown
Member

Fixes #340

serverFunctions.components now accepts 'external' alongside booleans. It behaves exactly like true everywhere (same transforms, same codegen — every derived serverComponents flag is truthiness-based, so 'external' flows as enabled), but declares that a composing host (the Astro adapter, TanStack Start's Solid integration) owns the document wiring — render plugin + client-side installServerComponents() call — itself, so the configResolved without-SSR-start-mode warning is skipped. Under full SSR start mode it's redundant but harmless: treated exactly as true, no redundancy warning.

Also fixes the stale warning text for the remaining true path: it still listed "the bootstrap script" as a required app-side piece, but head bootstrap injection was removed (serialized server-component references self-bootstrap the registry). The message now names the render plugin (with the direct-call transform) and installServerComponents(), and points hosts at components: 'external'.

  • src/server-functions/index.ts: widen the option type, refresh the JSDoc
  • src/index.ts: skip the warning on 'external', reword the message
  • README.md: document 'external' in the server-components section (reuses the external vocabulary, cf. start.external)
  • .changeset/server-components-external.md: patch changeset
  • examples/start-ssr/test/components-warning.mjs (chained into the suite's test script): config-level assertions that true warns with the updated text (no "bootstrap" mention, mentions 'external'), 'external' is silent yet still enabled (serve-time pre-bundle of the server-components runtime matches true), off stays off, and 'external' under SSR start mode is silent

Local gate: pnpm build (rollup + tsc) green, node test/components-warning.mjs 9/9, node test/run.mjs frames 61/61.

Made with Cursor

…ument wiring

Co-authored-by: Cursor <cursoragent@cursor.com>
@changeset-bot

changeset-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cf13314

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@solidjs/vite-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Sep 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@solidjs/vite-plugin@341

commit: cf13314

@ryansolid
ryansolid merged commit 7b3ef1f into next Sep 2, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant